﻿using UnityEditor;
using UnityEngine;

namespace XUProtobuf
{
    namespace Editor
    {
        internal class XUProtobufConverterWindow : EditorWindow
        {
            [MenuItem("XUPK/XUProtobuf/Configure", false, 1)]
            public static void SetConfig()
            {
                EditorWindow window = GetWindow<XUProtobufConverterWindow>("Protobuf");
                window.minSize = window.maxSize = new Vector2(800, 400);
                window.Show();
            }

            private XUProtobufConverterSetting setting = null;

            private void OnGUI()
            {
                if (setting == null)
                {
                    setting = XUProtobufConverterSetting.LoadOrCreate();
                }
                setting.OnGUI();
                setting.Save();
            }
        }
    }
}
